package command.example;

/**
 * @author Chen Guang
 * @date 2019/4/22 0022 上午 10:37
 */
public class Test {
    public static void main(String[] args) {
        Barbecuer boy = new Barbecuer();
        Command command = new BakeMuttonCommand(boy);
        Command command1 = new BakeMuttonCommand(boy);
        Command command2 = new BakeChickenWingCommand(boy);

        Waiter waiter = new Waiter();

        waiter.setOrder(command);
        waiter.setOrder(command1);
        waiter.setOrder(command2);

        Command command3 = new BakeChickenWingCommand(boy);
        ((BakeChickenWingCommand) command3).setStatus("没有鸡翅");
        waiter.setOrder(command3);

        Command command4 = new BakeMuttonCommand(boy);
        Command command5 = new BakeMuttonCommand(boy);
        waiter.setOrder(command4);
        waiter.setOrder(command5);

        waiter.cancelOrder(command5);

        waiter.notifyCommand();
    }
}
